<template>
  <el-dialog
    v-model="isShow"
    :title="handle.name + name"
    width="80%"
    :close-on-click-modal="false"
    @close="handleClose"
  >
    <el-form class="dialog-form" label-width="194px">
      <el-row :gutter="20">
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="行驶证主页：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人姓名" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="行驶证副页：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人手机号" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="行驶证副页背面：">
            <el-input v-model="form.publicName" placeholder="请输入承接人" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="道路运输证：">
            <el-switch v-model="form.isAddPhone" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="人车合照：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人姓名" />
          </el-form-item>
        </el-col>
        <el-col :xs="24"></el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="车牌号码：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人姓名" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="所属承运商：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人姓名" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="默认司机：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人姓名" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="车型：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人姓名" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="车长：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人姓名" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="车宽：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人姓名" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="能源类型：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人姓名" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="车胎数量：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人姓名" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="轴数：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人姓名" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="GPS设备号：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人姓名" />
          </el-form-item>
        </el-col>
        <el-col :xs="24">
          <el-divider />
          行驶证信息
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="档案编号：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人姓名" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="核定载人数：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人姓名" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="车牌颜色：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人姓名" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="品牌型号：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人姓名" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="发动机号码：">
            <el-input v-model="form.publicName" placeholder="请输入托运联系人姓名" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="使用性质：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="车辆识别代码：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="行驶证发证日期：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="行驶证注册日期：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="行驶证到期日期：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="道路运输证号码：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="道路运输证到期日：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="核定载质量（kg)：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="整备质量 (kg)：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="总质量 (kg)：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="准牵引总质量 (kg)：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="行驶证发证机关：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="外廓尺寸：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="净空：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="强制报废日：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="所有人：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="所有人手机号：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="所有人证件号码：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="道路运输经营许可证号：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :lg="8">
          <el-form-item label="道路运输经营许可证有效期：">
            <el-input v-model="form.publicName" placeholder="请输入" />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="isShow = false">取消</el-button>
        <el-button type="primary" :loading="btnLoading" @click="toSubmit">确定</el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script setup lang="ts">
import {ElMessage, ElMessageBox} from 'element-plus'
import { ref, reactive, getCurrentInstance, nextTick } from 'vue';
import { useAddEdit } from '/@/assets/compositionFn/addEdit';
const obj = {
  api: '/api/admin/param',
  initForm:{
    id: null,
    publicName: null,
    publicKey: null,
    publicValue: null,
    status: '0',
    systemFlag: null,
    isAddPhone: false,
  },
};
let {isShow, btnLoading, handle, optionData, form, init, returnInfo, handleClose, submitForm} = useAddEdit(obj);
const emit = defineEmits(['confirm']);
const {proxy} :any = getCurrentInstance();
const prop = defineProps({
  name: {
    type: String,
  }
});
watch(isShow,(newVal, oldVal) => {
  if(newVal){
    //弹窗后的其他操作
    let info = returnInfo();
  }
});
let goods = reactive({
  defaultObj:{

  },
  list:[
    {id:1}
  ],
});
const addGoods = () => {
  goods.list.push({id:2})
}
const deleteGoods = (index) => {
  goods.list.split(index,1);
}

const verifyForm = ()=>{
  if(!proxy.$verify.null(form.publicName, '请填写名称')){
    return false;
  }
  if(!proxy.$verify.null(form.publicKey, '请填写键')){
    return false;
  }
  if(!proxy.$verify.null(form.publicValue, '请填写值')){
    return false;
  }
  if(!proxy.$verify.null(form.systemFlag, '请选择类型')){
    return false;
  }
  return true;
};
const toSubmit = ()=>{
  if(!verifyForm()){
    return;
  }
  submitForm().then(res => {
    emit('confirm');
  });
  
}
defineExpose({
  init,
})
</script>

<style>

</style>